<template>
  <div class="divBox" style="padding-bottom:0;">
    <el-row :gutter="20" class="baseInfo">
      <div @click="skip1">
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div class="acea-row row-between-wrapper">
              <div class="acea-row align-center">
                <span class="main_tit">用户注册数量</span>
              </div>
            </div>
            <div class="content" v-if="viewData">
              <span class="content-number spBlock my15">{{ viewData.registrationsNum }}</span>
            </div>
          </el-card>
        </el-col>
      </div>
      <div @click="skip2">
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div class="acea-row row-between-wrapper">
              <div class="acea-row align-center">
                <span class="main_tit">用户反馈数量</span>
              </div>
            </div>
            <div class="content" v-if="viewData">
              <span class="content-number spBlock my15">{{ viewData.feedbackNum }}</span>
            </div>
          </el-card>
        </el-col>
      </div>
      <div @click="skip3">
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div class="acea-row row-between-wrapper">
              <div class="acea-row align-center">
                <span class="main_tit">欠费用户数</span>
              </div>
            </div>
            <div class="content" v-if="viewData">
              <span class="content-number spBlock my15">{{ viewData.arrearsUserNum }}</span>
            </div>
          </el-card>
        </el-col>
      </div>
      <div @click="skip4">
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div class="acea-row row-between-wrapper">
              <div class="acea-row align-center">
                <span class="main_tit">设备数量</span>
              </div>
            </div>
            <div class="content" v-if="viewData">
              <span class="content-number spBlock my15">{{ viewData.devicesNum }}</span>
            </div>
          </el-card>
        </el-col>
      </div>
      <div @click="skip5">
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div class="acea-row row-between-wrapper">
              <div class="acea-row align-center">
                <span class="main_tit">异常设备数量</span>
              </div>
            </div>
            <div class="content" v-if="viewData">
              <span class="content-number spBlock my15">{{ viewData.abnormalDevicesNum }}</span>
            </div>
          </el-card>
        </el-col>
      </div>
      <div @click="skip6">
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div class="acea-row row-between-wrapper">
              <div class="acea-row align-center">
                <span class="main_tit">缴费金额</span>
              </div>
            </div>
            <div class="content" v-if="viewData">
              <span class="content-number spBlock my15">{{ viewData.paymentAmount }}</span>
            </div>
          </el-card>
        </el-col>
      </div>
    </el-row>
  </div>
</template>
<script>
// import {viewModelApi} from '@/api/dashboard'

export default {
  props:{
    viewData: {
      type: Object,
      default: () => {
        return {}
      }
    },
  },
  data() {
    return {
      grid: {xl: 4, lg: 4, md: 4, sm: 4, xs: 4},
      filtrate: 10,
    }
  },
  methods: {
    skip1() {
      this.$router.push({name: 'User',})
    },
    skip2() {
      this.$router.push({name: 'Complaints',})
    },
    skip3() {
      this.$router.push({name: 'User'})
    },
    skip4() {
      this.$router.push({name: 'Equipment',})
    },
    skip5() {
      this.$router.push({name: 'Equipment',})
    },
    skip6() {
      this.$router.push({name: 'Payment',})
    },
    //数据统计
    // statisticsOrder() {
    //   viewModelApi().then(async res => {
    //     //后期接口调用
    //     this.viewData = res;
    //   })
    // },
    mounted() {
      // this.statisticsOrder();
    }
  }
}
</script>
<style scoped lang="scss">
::v-deep {
  .el-col-xl-6 {
    width: 20%;
  }
}

.ivu-mb {
  margin-bottom: 20px;
}

.up, .el-icon-caret-top {
  color: #F5222D;
  font-size: 12px;
  opacity: 1 !important;
}

.down, .el-icon-caret-bottom {
  color: #39C15B;
  font-size: 12px;
  /*opacity: 100% !important;*/
}

.main_tit {
  color: #333;
  font-size: 14px;
  font-weight: 500;
}

.content-time {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.main_badge {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  margin-right: 10px;
  background: #2C90FF;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

.my15 {
  margin: 15px 0 15px;
}

.align-center {
  align-items: center;
}

.baseInfo {
  ::v-deep .el-card__header {
    padding: 15px 20px !important;
  }
}

.content {
  &-number {
    font-size: 30px;
    font-weight: 600;
    font-family: PingFangSC-Semibold, PingFang SC;
    color: #333;
  }

  &-time {
    font-size: 14px;
    color: #333333;
    font-weight: 400;
  }
}
</style>
